#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import subprocess

class ShellUtil() :

    @staticmethod
    def execute(logger, command) :
        logger.debug("execute shell command start : %s" % command)
        lines = []
        p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        for line in p.stdout.readlines() :
            logger.debug("execute shell command result : %s" % line)
            lines.append(line)
        logger.debug("start execute shell command end")
        return lines
